package com.example.yangjintingtest.domain;




import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.redis.core.index.Indexed;


import java.util.List;


@Data
@RedisHash("persons") // 指定操作实体类对象在Redis数据库中的存储空间
//@Component // 用于将Person类作为Bean注入到Spring容器中
//@ConfigurationProperties(prefix = "person")// 将配置文件中以person开头的属性注入到该类中
public class Person {
    @Id  // 标识实体类主键
    private String id;
    @Indexed  // 标识对应属性在Redis数据库中生成二级索引
    private String firstname;
    @Indexed
    private String lastname;
    private Address address;
    private List<Family> familyList;

    public Person() {
    }

    public Person(String firstname, String lastname) {
        this.firstname = firstname;
        this.lastname = lastname;
    }
}